package com.gdut.huayan.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gdut.huayan.validation.NumRange;
import com.gdut.huayan.validation.group.GroupAdd;
import com.gdut.huayan.validation.group.GroupUpdate;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;


@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_limit_name")
public class LimitName implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Null(groups = {GroupAdd.class})
    @NotNull(groups = {GroupUpdate.class})
    private Long id;

    /**
     * 活动id
     */
    private Long activityId;

    /**
     * 姓名类型：1-往生先人，2-阳上，3-慈善人姓名 4-地基主
     */
    @NumRange(min = 1,max = 4,message = "姓名类型错误")
    @NotNull(groups = {GroupAdd.class},message = "名字类型不能为空")
    private Integer nameType;

    /**
     * 数量
     */
    @Min(value = 0,message = "大牌位数量不能小于0")
    @NotNull(groups = {GroupAdd.class},message = "bigAmount数量不能为空")
    private Integer bigAmount;

    @Min(value = 0,message = "中牌位数量不能小于0")
    private Integer middleAmount;

    @Min(value = 0,message = "小牌位数量不能小于0")
    private Integer littleAmount;

    /**
     * 是否是企业字段限制
     */
    @NumRange(min = 1,max = 2, message="isCompany类型错误")
    @NotNull(groups = {GroupAdd.class} , message = "isCompany字段不能为空")
    private Integer isCompany;


}
